Style

Plots may be displayed in one of six styles: lines, points, linespoints, impulses, dots, or errorbars. The lines style connects adjacent points with lines. The points style displays a small symbol at each point. The linespoints style does both lines and points. The impulses style displays a vertical line from the x axis (or from the grid base for splot) to each point. The dots style plots a tiny dot at each point; this is useful for scatter plots with many points.

The errorbars style is only relevant to 2-d data file plotting. It is treated like points for splots and function plots. For data plots, errorbars is like points, except that a vertical error bar is also drawn: for each point (x,y), a line is drawn from (x,ylow) to (x,yhigh). A tic mark is placed at the ends of the error bar. The ylow and yhigh values are read from the data file's columns, as specified with the using option to plot. See plot errorbars for more information.

Default styles are chosen with the set function style and set data style commands.

By default, each function and data file will use a different line type and point type, up to the maximum number of available types. All terminal drivers support at least six different point types, and re-use them, in order, if more than six are required. The LaTeX driver supplies an additional six point types (all variants of a circle), and thus will only repeat after twelve curves are plotted with points.

If desired, the style and (optionally) the line type and point type used for a curve can be specified.

Syntax:

        with <style> {<linetype> {<pointtype>}}

where <style> is either lines, points, linespoints, impulses, dots, or errorbars. The <linetype> and <pointtype> are positive integer constants or expressions and specify the line type and point type to be used for the plot. Line type 1 is the first line type used by default, line type 2 is the second line type used by default, etc.

Examples:

This plots sin(x) with impulses:

        plot sin(x) with impulses

This plots x*y with points, x**2 + y**2 default:

        splot x*y w points, x**2 + y**2

This plots tan(x) with the default function style, ``data.1'' with lines:

        plot [ ] [-2:5] tan(x), "data.1" with l

This plots ``leastsq.dat'' with impulses:

        plot 'leastsq.dat' w i

This plots ``exper.dat'' with errorbars and lines connecting the points:

        plot 'exper.dat' w lines, 'exper.dat' w errorbars
Here 'exper.dat' should have three or four data columns.

This plots x**2 + y**2 and x**2 - y**2 with the same line type:

        splot x**2 + y**2 with line 1, x**2 - y**2 with line 1

This plots sin(x) and cos(x) with linespoints, using the same line type but different point types:

        plot sin(x) with linesp 1 3, cos(x) with linesp 1 4

This plots file ``data'' with points style 3:

        plot "data" with points 1 3
Note that the line style must be specified when specifying the point style, even when it is irrelevant. Here the line style is 1 and the point style is 3, and the line style is irrelevant.

See set style to change the default styles.